/**
 * 
 */
package cn.gov.msa.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import cn.gov.msa.service.UserDetailService;
import net.sf.json.JSONObject;

/**
 * @Title: BaseObj.java
 * @Package cn.gov.msa.model
 * @Description: TODO(用一句话描述该文件做什么)
 * @author 何宇江
 * @date 2018年2月19日 下午6:04:38
 */
public class BaseObj implements Serializable {
	
	@Autowired
	UserDetailService userDetailService;
	
	BaseObj(){
		try {
			HttpServletRequest req = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
					.getRequest();
			if (req != null){
				UserDetail userDetail = (UserDetail)req.getSession().getAttribute("userDetail");
	    		if(userDetail != null){
	    			
	    			syscreatedby = userDetail.getUserid();
	        		syslastupdby = syscreatedby;
	        		
	        		syscreatedbyname = userDetail.getUsername();
	        		sysorg = userDetail.getOrgcode();
	        		sysorgname = userDetail.getOrgname();
	        		sysdept = userDetail.getDeptcode();
	        		sysdeptname = userDetail.getDeptname();
	    		}
			}
		} catch (Exception e) {
//			System.err.println("获取用户信息异常:" + this.getClass().getName());
//			e.printStackTrace();
		}
	}


    private Date syscreated;

    private String syscreatedby;

    private String syscreatedbyname;

    private String sysorg;

    private String sysorgname;

    private String sysdept;

    private String sysdeptname;

    private Date syslastupd;

    private String syslastupdby;



    public Date getSyscreated() {
        return syscreated;
    }

    public void setSyscreated(Date syscreated) {
        this.syscreated = syscreated;
    }

    public String getSyscreatedby() {
        return syscreatedby;
    }

    public void setSyscreatedby(String syscreatedby) {
        this.syscreatedby = syscreatedby;
    }

    public String getSyscreatedbyname() {
        return syscreatedbyname;
    }

    public void setSyscreatedbyname(String syscreatedbyname) {
        this.syscreatedbyname = syscreatedbyname;
    }

    public String getSysorg() {
        return sysorg;
    }

    public void setSysorg(String sysorg) {
        this.sysorg = sysorg;
    }

    public String getSysorgname() {
        return sysorgname;
    }

    public void setSysorgname(String sysorgname) {
        this.sysorgname = sysorgname;
    }

    public String getSysdept() {
        return sysdept;
    }

    public void setSysdept(String sysdept) {
        this.sysdept = sysdept;
    }

    public String getSysdeptname() {
        return sysdeptname;
    }

    public void setSysdeptname(String sysdeptname) {
        this.sysdeptname = sysdeptname;
    }

    public Date getSyslastupd() {
        return syslastupd;
    }

    public void setSyslastupd(Date syslastupd) {
        this.syslastupd = syslastupd;
    }

    public String getSyslastupdby() {
        return syslastupdby;
    }

    public void setSyslastupdby(String syslastupdby) {
        this.syslastupdby = syslastupdby;
    }
}
